package cn.edu.scau.cmi.xianjiehua.singleton;

public class Chairman {

	private static volatile Chairman singleton;
	
	private String name;
	
	private Chairman(String name){
		this.name = name;
	}
	
	public static Chairman getSingleton(String name){
		if(singleton == null){
			synchronized(Chairman.class){
				if(singleton == null)
					singleton = new Chairman(name);
			}
		}
		return singleton;
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getName(){
		return this.name;
	}
	
	public void excuteOfDuty(){
		System.out.println("ͬ־");
	}
	
}